import os
import os.path
path = r'F:\pythontest\20183122'
os.mkdir(path)
file = open(r'F:\pythontest\20183122\20183122.txt','w')
file.write(" 学号\t\t姓名\t课程名称\t\t课程成绩\n")
file.write("20183122\t陈介\tPython程序设计\t    97\n")
file.close()
file = open(r'F:\pythontest\20183122\20183122.txt','a+')
file.write("20183126\t杨俊杰\tPython程序设计\t    95\n")
file.write("20183101\t王远宁\t大学英语读写教程\t    94\n")
file.close()
file = open(r'F:\pythontest\20183122\20183122.txt','r')
list1 = file.readlines()
for item in list1:
    print(item)
file.close()
print("文件成功关闭?",file.closed)